﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiXuLong.Model;
namespace ShiXuLong.Service
{
    public class Login
    {
        ShoesEntities db = new ShoesEntities();
        public bool UserLogin(string un, string pwd)
        {
            try
            {
                var user = db.Users.Where(p => p.UserName.Equals(un) && p.UserTypeId == 2).SingleOrDefault();

                if (user.UserName.Equals(un) && user.UserPwd == pwd && user.UserTypeId == 2)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {

                return false;
            }


        }

    }
}
